<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>四则运算</title>
    <script>
        window.onload=function(){
            document.getElementsByTagName("input")[3].onclick=function(){
                var radius1=document.getElementsByTagName("input")[0].value;
                var radius2=document.getElementsByTagName("input")[1].value;
                document.getElementsByTagName("input")[2].value=Number(radius1)+Number(radius2);
            }
            document.getElementsByTagName("input")[4].onclick=function(){
                var radius1=document.getElementsByTagName("input")[0].value;
                var radius2=document.getElementsByTagName("input")[1].value;
                document.getElementsByTagName("input")[2].value=Number(radius1)-Number(radius2);
                
            }
            document.getElementsByTagName("input")[5].onclick=function(){
                var radius1=document.getElementsByTagName("input")[0].value;
                var radius2=document.getElementsByTagName("input")[1].value;
                document.getElementsByTagName("input")[2].value=Number(radius1)*Number(radius2); 
            }
            document.getElementsByTagName("input")[6].onclick=function(){
                var radius1=document.getElementsByTagName("input")[0].value;
                var radius2=document.getElementsByTagName("input")[1].value;
                document.getElementsByTagName("input")[2].value=Number(radius1)/Number(radius2); 
            }
        }
    </script>
</head>
<body>
    <h2>四则运算</h2>
    数值：<input type="text" name="" id="" placeholder="请输入第一个数"><br>
    数值：<input type="text" name="" id="" placeholder="请输入第二个数"><br>
    结果：<input type="text" name="" id="" placeholder="结果"><br>
    <input type="button" value="加" onclick="function_name()">
    <input type="button" value="减">
    <input type="button" value="乘">
    <input type="button" value="除">
</body>
</html>